//
//  LGCiTangMineZuPuViewController.m
//  ligenyun
//
//  Created by Mac on 2018/3/26.
//  Copyright © 2018年 stoneobs@icloud.com. All rights reserved.
//

#import "LGGraveyardDetailViewController.h"
#import "LGGraveyarChildDetailViewController.h"
#import "LGGraverarPhotoViewController.h"
#import "LGGraverarServiceViewController.h"
#import "LGGraverarCommentViewController.h"
@interface LGGraveyardDetailViewController ()
@property(nonatomic, strong) STSegementButton     *segementButton;
@property(nonatomic, strong) UIScrollView     *scrollView;
@end

@implementation LGGraveyardDetailViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = @"圆陵墓地";
    
    __weak typeof(self) weakSelf = self;
    self.segementButton = [[STSegementButton alloc] initWithFrame:CGRectMake(0, [TMUtils navgationBarBootom], UIScreenWidth, 49)
                                                         andTitle:@[@"详情",@"图库",@"服务",@"评价"] handle:^(STSegementButton *sender) {
                                                             if (weakSelf.segementButton.cureentIndex == 1) {
                                                                 [weakSelf.scrollView setContentOffset:CGPointMake(UIScreenWidth, 0) animated:YES];
                                                             }else if(weakSelf.segementButton.cureentIndex == 2){
                                                                 [weakSelf.scrollView setContentOffset:CGPointMake(2*UIScreenWidth, 0) animated:YES];
                                                             }
                                                             else if(weakSelf.segementButton.cureentIndex == 3){
                                                                 [weakSelf.scrollView setContentOffset:CGPointMake(3*UIScreenWidth, 0) animated:YES];
                                                             }
                                                             else{
                                                                 [weakSelf.scrollView setContentOffset:CGPointMake(0, 0) animated:YES];
                                                             }
                                                             // [weakSelf.tableView reloadData];
                                                         }];
    self.segementButton.backgroundColor = [UIColor whiteColor];
    self.segementButton.lineSelectedColor = TM_redColor;
    self.segementButton.butTitleSelectedColor = TM_redColor;
    self.segementButton.butTitleColor = TM_secendTextColor;
    self.segementButton.lineColor = [UIColor whiteColor];
    self.segementButton.cureentIndex = 0;
    self.segementButton.autoMoveWithClic = YES;
    [self.view addSubview:self.segementButton];
    
    self.scrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, self.segementButton.bottom, UIScreenWidth, [TMUtils tabBarTop] - self.segementButton.bottom + 49)];
    self.scrollView.scrollEnabled = NO;
    self.scrollView.backgroundColor = [UIColor whiteColor];
    self.scrollView.contentSize = CGSizeMake(3 * UIScreenWidth, 0);
    [self.view addSubview:self.scrollView];
    
    LGGraveyarChildDetailViewController * vc =  [LGGraveyarChildDetailViewController new];
    [self addChildViewController:vc];
    UIView * view = vc.view;
    [self.scrollView addSubview:view];
    
    LGGraverarPhotoViewController * taijiVC = [LGGraverarPhotoViewController new];
    [self addChildViewController:taijiVC];
    UIView * listView = taijiVC.view;
    listView.left= UIScreenWidth;
    [self.scrollView addSubview:listView];
    
    
    LGGraverarServiceViewController * zhizhiVC = [LGGraverarServiceViewController new];
    [self addChildViewController:zhizhiVC];
    UIView * zhizhiView = zhizhiVC.view;
    zhizhiView.left= UIScreenWidth * 2;
    [self.scrollView addSubview:zhizhiView];
    
    LGGraverarCommentViewController * coometVC = [LGGraverarCommentViewController new];
    [self addChildViewController:coometVC];
    UIView * commentView = coometVC.view;
    commentView.left= UIScreenWidth * 3;
    [self.scrollView addSubview:commentView];
    // Do any additional setup after loading the view.
}


@end

